<?php
/**
 * 获取配配置
 * @param $key 配置的名称
 */
function get_config($key){
	$config = include(BASE_PATH.'config.php');
	return $config[$key];
}
/**
 * 下载文件
 * @param $url      下载地址
 * @param $filename 保存地址
 */
function download(){
}
/**
 * 获取采集器类表
 */
function get_collecter_list(){
	$collecter_path = BASE_PATH.'drive/photo/';
	$dh=opendir($collecter_path);
	$collecter_list = array();
	while($file = readdir($dh)){
		if($file != '.' && $file != '..'){
			if(!is_dir($collecter_path.'/'.$file)){		
				include_once($collecter_path.'/'.$file);
				$class_name = str_replace('.class.php','',$file);
				$tmp = new $class_name();
				$collecter['name'] = str_replace('Collect','',$class_name);
				$collecter['url']  = $tmp->site_url;
				$collecter_list[]  = $collecter;
			}
		}
	}
	return $collecter_list;
}
/**
 * 获取时间
 */
function microtime_float(){
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}